#ifndef __STRUCTURE_KERNEL__
#define __STRUCTURE_KERNEL__

#if defined(__HOST_CODE__) && !defined(__KERNEL_CODE__)

	typedef struct{
		float cen[4];
		float color[4];
		float rad;
		float reflect;
	    float diffuse;
	}Sphere;

	typedef struct{
		float  n[4];
		float color[4];
		float  d;
		float reflect;
	    float diffuse;
	}Plane;

#endif

#if !defined(__HOST_CODE__) && defined(__KERNEL_CODE__)

// memory alignment with host struct
#pragma pack(push)
#pragma pack(4)
	typedef struct{
		float4 cen;
		float4 color;
		float rad;
		float reflect;
	    float diffuse; 
	}Sphere;
#pragma pack(pop)

#pragma pack(push)
#pragma pack(4)
	typedef struct{
		float4 n;
		float4 color;
		float d;
		float reflect;
	    float diffuse;
	}Plane;

#pragma pack(pop)

// kernel internel struct
	typedef enum __hitType{MISS = 0, SPHERE, PLANE, LIGHT} HitType;

    typedef struct __Ray
	{
		float4 ori;
		float4 dir;
        float minT;
        HitType hitType;
        int hitID;
	}Ray;

#endif

#endif